<UserControl x:Class="SalesPoint.Views.CustomerListView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <DockPanel>
        <ToolBar DockPanel.Dock="Top"
                 HorizontalAlignment="Left">
            <ToolBar.Resources>
                <ResourceDictionary>
                    <ResourceDictionary.MergedDictionaries>
                        <ResourceDictionary Source="../Resources/ToolBarStyles.xaml" />
                    </ResourceDictionary.MergedDictionaries>
                </ResourceDictionary>
            </ToolBar.Resources>
            <Button Command="{Binding AddItemCommand}">Add</Button>
            <Button Command="{Binding EditItemCommand}">Edit</Button>
            <Button Command="{Binding RemoveItemCommand}">Remove</Button>
        </ToolBar>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="2*"></RowDefinition>
                <RowDefinition Height="4"></RowDefinition>
                <RowDefinition Height="*"
                               MinHeight="180"></RowDefinition>
            </Grid.RowDefinitions>
            <DataGrid Grid.Row="0"
                      ItemsSource="{Binding Items}"
                      IsReadOnly="True"
                      AutoGenerateColumns="False"
                      SelectionMode="Single"
                      SelectedItem="{Binding Item}"
                      RowHeight="24"
                      GridLinesVisibility="None">
                <DataGrid.Resources>
                    <ResourceDictionary>
                        <ResourceDictionary.MergedDictionaries>
                            <ResourceDictionary Source="../Resources/ItemListStyles.xaml" />
                        </ResourceDictionary.MergedDictionaries>
                    </ResourceDictionary>
                </DataGrid.Resources>
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Id"
                                        Binding="{Binding Id}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                    <DataGridTextColumn Header="Company Name"
                                        Binding="{Binding CompanyName}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                    <DataGridTextColumn Header="Contact"
                                        Binding="{Binding ContactName}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                    <DataGridTextColumn Header="Contact Title"
                                        Binding="{Binding ContactTitle}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                    <DataGridTextColumn Header="Country"
                                        Binding="{Binding Path=Address.Country}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                    <DataGridTextColumn Header="Region"
                                        Binding="{Binding Path=Address.Region}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                    <DataGridTextColumn Header="City"
                                        Binding="{Binding Path=Address.City}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                    <DataGridTextColumn Header="Postal Code"
                                        Binding="{Binding Path=Address.PostalCode}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                    <DataGridTextColumn Header="Street Address"
                                        Binding="{Binding Path=Address.StreetAddress}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                    <DataGridTextColumn Header="Phone"
                                        Binding="{Binding Phone}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                    <DataGridTextColumn Header="Fax"
                                        Binding="{Binding Fax}"
                                        ElementStyle="{StaticResource DefaultCellStyle}" />
                </DataGrid.Columns>
            </DataGrid>
            <GridSplitter Grid.Row="1"
                          HorizontalAlignment="Stretch" />
            <Grid Grid.Row="2"
                  VerticalAlignment="Top"
                  Margin="0,10,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="10"></ColumnDefinition>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="26"></RowDefinition>
                    <RowDefinition Height="26"></RowDefinition>
                    <RowDefinition Height="26"></RowDefinition>
                    <RowDefinition Height="26"></RowDefinition>
                    <RowDefinition Height="26"></RowDefinition>
                    <RowDefinition Height="26"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.Resources>
                    <ResourceDictionary>
                        <ResourceDictionary.MergedDictionaries>
                            <ResourceDictionary Source="../Resources/ItemViewerStyles.xaml" />
                        </ResourceDictionary.MergedDictionaries>
                    </ResourceDictionary>
                </Grid.Resources>
                <Label Grid.Row="0"
                       Grid.Column="0">Id</Label>
                <Label Grid.Row="1"
                       Grid.Column="0">Company Name</Label>
                <Label Grid.Row="2"
                       Grid.Column="0">Country</Label>
                <Label Grid.Row="3"
                       Grid.Column="0">Region</Label>
                <Label Grid.Row="4"
                       Grid.Column="0">City</Label>
                <Label Grid.Row="5"
                       Grid.Column="0">Postal Code</Label>

                <Label Grid.Row="0"
                       Grid.Column="3">Contact</Label>
                <Label Grid.Row="1"
                       Grid.Column="3">Contact Title</Label>
                <Label Grid.Row="2"
                       Grid.Column="3">Street Address</Label>
                <Label Grid.Row="3"
                       Grid.Column="3">Phone</Label>
                <Label Grid.Row="4"
                       Grid.Column="3">Fax</Label>

                <TextBox Grid.Row="0"
                         Grid.Column="1"
                         Text="{Binding Path=Item.Id, Mode=OneWay}"
                         IsReadOnly="True"></TextBox>
                <TextBox Grid.Row="1"
                         Grid.Column="1"
                         Text="{Binding Path=Item.CompanyName}"></TextBox>
                <TextBox Grid.Row="2"
                         Grid.Column="1"
                         Text="{Binding Path=Item.Address.Country}"></TextBox>
                <TextBox Grid.Row="3"
                         Grid.Column="1"
                         Text="{Binding Path=Item.Address.Region}"></TextBox>
                <TextBox Grid.Row="4"
                         Grid.Column="1"
                         Text="{Binding Path=Item.Address.City}"></TextBox>
                <TextBox Grid.Row="5"
                         Grid.Column="1"
                         Text="{Binding Path=Item.Address.PostalCode}"></TextBox>

                <TextBox Grid.Row="0"
                         Grid.Column="4"
                         Text="{Binding Path=Item.ContactName}"></TextBox>
                <TextBox Grid.Row="1"
                         Grid.Column="4"
                         Text="{Binding Path=Item.ContactTitle}"></TextBox>
                <TextBox Grid.Row="2"
                         Grid.Column="4"
                         Text="{Binding Path=Item.Address.StreetAddress}"></TextBox>
                <TextBox Grid.Row="3"
                         Grid.Column="4"
                         Text="{Binding Path=Item.Phone}"></TextBox>
                <TextBox Grid.Row="4"
                         Grid.Column="4"
                         Text="{Binding Path=Item.Fax}"></TextBox>
            </Grid>
        </Grid>
    </DockPanel>
</UserControl>
